var gulp = require('gulp')
var plugins = require('gulp-load-plugins')();
var colors = require('colors')
gulp.task('default',function(){
  return plugins.watch('./**/*.scss', function(){
    console.log("0.0 ".blue + new Date().toLocaleTimeString() + ' : watch scss file change'.blue)
    gulp.src(['./**/*.scss','!node_modules/**'])
      .pipe(plugins.plumber())
      .pipe(plugins.sass({outputStyle: 'expanded'}).on('error', plugins.sass.logError))
      .pipe(plugins.rename(function(path){
        path.extname = ".wxss";
        console.log("√   ".green + new Date().toLocaleTimeString() + " : rename success".green);
      }))
      .pipe(gulp.dest("./"))
  })
})